home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: netcom.com!sergeboj
- From: sergeboj@netcom.com (Serge Bojoulitch)
- Subject: Re: HELP! Modifying the EOF in a file!
- Message-ID: <sergebojDo7264.824@netcom.com>
- Organization: NETCOM On-line Communication Services (408 261-4700 guest)
- X-Newsreader: TIN [version 1.2 PL1]
- References: <4i585k$4ia@news.netam.net> <4i5pb4$fae@sparcserver.lrz-muenchen.de>
- Date: Wed, 13 Mar 1996 07:01:16 GMT
- Sender: sergeboj@netcom15.netcom.com
-
- ua302aa@lrz-muenchen.de wrote:
- : >Why doesn't the EOF character chop off the remaining two lines?
-
- : Since a file can be seen as a sequence of char, and since EOF is
- : _not_ a char, who knows.
-
- : Kurt
-
- For the simple reason that in most implementations EOF is defined
- as -1 to indicate error status. When you use
-
- fprintf(dat,"Hello! %c",EOF);
-
- it is the same as
-
- fprintf(dat,"Hello! %c",oxff);
-
- or, possibly,
-
- fprintf(dat,"Hello! %c",oxffff);
-
- The EOF character for ASCII files is ASCII 4 (in old UNIX).
-
- Regards,
-
- Serge Bojoulitch
-